package br.com.application.dao;

import android.database.sqlite.SQLiteDatabase;

public class DAOSQLite {

	private SQLiteDatabase banco;
	public static final String DBNAME ="dbb4a";

	public DAOSQLite(SQLiteDatabase banco){
		this.banco = banco;    
	}
	
	public boolean createTables(){
		try{
			banco.execSQL(  " CREATE TABLE IF NOT EXISTS ESTUDANTES ( 		" +
							" MATRICULA VARCHAR(10) PRIMARY KEY,    	    " +
					        " NOME VARCHAR(80),                             " +
							" TURMA INTEGER                                 " +
							" );"
			);
			
			banco.execSQL(  " CREATE TABLE IF NOT EXISTS MENSAGENS (	    " +
								" ID INT PRIMARY KEY AUTOINCREMENT,		    " +
						        " TITULO VARCHAR(50),                       " +
						        " CONTEUDO VARCHAR(500),                   	" +
								" DATAINICIAL VARCHAR(10),                  " +
						        " DATAFINAL VARCHAR(10)                  	" +
								" READ INT								    " +
						        " );"
			);
			
			return true;
		}catch (Exception e) {
			e.printStackTrace();
			return false;
		}
	}
	
}
